<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品规格添加</title>
    <meta content="webkit" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
    <link href="../../lib/layui-v2.6.3/css/layui.css" media="all" rel="stylesheet">
    <link href="../../css/public.css" media="all" rel="stylesheet">
    <script src="../../lib/layui-v2.6.3/layui.js"></script>
    <script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
    <script src="../../js/template-web.js"></script>
    <script src="../../js/lay-module/layuimini/miniTab.js"></script>
</head>
<body>
<div>
    <div class="layui-form"
         style="margin: 0 auto;max-width: 900px;padding-top: 50px;padding-left: 301px;background-color: #FFFFFF;">
        <div class="layui-inline" style="position: relative;left: -100px">
            <label class="layui-form-label">类别筛选：</label>
            <div class="layui-input-inline">
                <select id="selectOnekindID" lay-filter="selectTesttwe"></select>
            </div>
        </div>
        <!--    //商品id-->
        <div class="layui-inline" style="position: relative;left: -50px">
            <label class="layui-form-label">新商品ID：</label>
            <div class="layui-input-inline">
                <input class="layui-input" disabled id="newcommtityID"/>
            </div>
        </div>
        <div class="layui-form-item" style="height: 500px">
            <div class="layui-card-body" id="my-table" style="position: relative;left: -210px">
                <table class="layui-hide" id="Tablestop" lay-filter="Tabletest"></table>
            </div>
        </div>
        <!--    <div class="layui-form-item" style="position: relative;top: -10px">-->
        <!--      <div class="layui-input-block">-->
        <!--        <button class="layui-btn" lay-event="getCheckData"  lay-filter="formStep2" id="addCommotityBtn">-->
        <!--          &emsp;确认添加&emsp;-->
        <!--        </button>-->
        <!--      </div>-->
        <!--    </div>-->
    </div>
</div>
</body>
<script id="toolbarDemo" type="text/html">
    <div class="layui-btn-container" style="position: relative;left: 318px;top: 420px">
        <button class="layui-btn" lay-event="getCheckData">确定添加</button>
    </div>
</script>
<script id="forword1" type="text/template">
    <option></option>
    {{each datebate1 value}}
    {{if value.upname==null}}
    <option value="{{value.id}}">{{@value.k_name}}</option>
    {{else}}
    <option value="{{value.id}}">{{@value.upname}}/{{@value.k_name}}</option>
    {{/if}}
    {{/each}}
</script>
<script id="inputnumber" type="text/html">
    <div class="layui-input-inline">
        <input class="layui-input" lay-filter="linkFilter" lay-event="linkEvent" placeholder="请输入价格" id="inputTable"
               value="00"/>
    </div>
</script>
<script>

    layui.use(['form', 'table'], function () {
        var form = layui.form;
        var layer = layui.layer;
        var table = layui.table;
        var miniTab = layui.miniTab;

        function az() {
            //获取最新商品ID
            $.post("/newID", function (ex) {
                $("#newcommtityID").val(ex)
            })
            //加载类别
            $.get("/kind", function (result) {
                date = {datebate1: result}
                mera = template("forword1", date);
                $("#selectOnekindID").append(mera);
                form.render('select');
            })
        }

        az();
    })
</script>
</html>